package com.taoym.voucher.xcx.controller;

import com.taoym.voucher.common.response.Response;
import com.taoym.voucher.xcx.entity.vo.XcxGetActivityVO;
import com.taoym.voucher.xcx.service.XcxActivityService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @coder taoym
 * @datetime 2021/9/22 15:16
 * @desc
 */
@RestController
@RequestMapping("/activity")
@Api(tags = "小程序活动信息")
public class XcxActivityController {

    @Autowired
    private XcxActivityService xcxActivityService;

    @GetMapping("/list")
    public Response<List<XcxGetActivityVO>> listActivities(@RequestParam @NotNull(message = "活动平台不能为空") Integer platform) {
        return Response.success(xcxActivityService.listActivities(platform));
    }
}
